Security: Fix bundler-audit vulnerabilities#20
Closed
polographer wants to merge 1 commit intotrunkfrom
Closed
Conversation
This commit updates vulnerable gems identified by bundler-audit. See PR description for detailed analysis of changes and affected components.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
================================================================================
GEM VULNERABILITY UPDATE REVIEW
Date: March 25, 2026
Status: All vulnerabilities resolved
Gems Updated: 4 (json, loofah, nokogiri, rack)
================================================================================
================================================================================
VERSION CHANGE:
2.18.0 → 2.19.3
VULNERABILITY DETAILS:
POTENTIAL IMPACT AREAS:
⚠️ HIGH PRIORITY - Authentication & Authorization
• Parses requesting identity data from Base64-decoded headers
• Location: validate_resource_identity_signature.rb:46
• Risk: JSON parsing of authentication data is security-critical
• Document creation endpoint parses JSON from request params
• Location: documents_controller.rb:113
• Risk: User input parsing could be exploited
ℹ️ LOW PRIORITY - Test Suite
• Multiple JSON.parse() calls in test specs
• Used for parsing test responses and creating fixtures
• Risk: Minimal - test-only usage
FUNCTIONAL AREAS:
RECOMMENDATIONS:
• Test authentication flow thoroughly (identity header parsing)
• Verify document creation endpoint handles malformed JSON gracefully
• Review all JSON.parse() operations for proper error handling
• Run integration tests for API endpoints
================================================================================
2. LOOFAH GEM
VERSION CHANGE:
2.25.0 → 2.25.1
VULNERABILITY DETAILS:
POTENTIAL IMPACT AREAS:
ℹ️ LOW DIRECT RISK - Rails Framework Dependency
• Installed as transitive dependency via rails-html-sanitizer (v1.6.2)
• No explicit Loofah calls found in application code
• Application is API-only (config.api_only = true)
FUNCTIONAL AREAS:
USAGE NOTES:
• Not directly used in application code
• Application doesn't render HTML views or process HTML content
• Minimal risk due to API-only configuration
RECOMMENDATIONS:
• Monitor for updates but low priority given no direct usage
• No specific testing required unless HTML processing is added
================================================================================
3. NOKOGIRI GEM
VERSION CHANGE:
1.19.0 → 1.19.2
VULNERABILITY DETAILS:
POTENTIAL IMPACT AREAS:
ℹ️ LOW DIRECT RISK - Rails Framework Dependency
• Required by ActionPack, ActionText, and rails-dom-testing
• No explicit XML/HTML parsing in application code
• No web scraping or document processing operations
FUNCTIONAL AREAS:
USAGE NOTES:
• Not directly used in application code
• Application processes binary documents (PDFs via Shrine), not XML/HTML
• Framework uses it internally for testing and ActionText support
RECOMMENDATIONS:
• Monitor for updates but low priority given no direct usage
• No specific testing required unless XML/HTML processing is added
================================================================================
4. RACK GEM
VERSION CHANGE:
3.2.4 → 3.2.5
VULNERABILITY DETAILS:
POTENTIAL IMPACT AREAS:
⚠️ HIGH PRIORITY - CORS Configuration
• Rack::Cors middleware limits cross-origin access
• Location: initializers/cors.rb
• Configuration: Restricted to 'hotfix-2-enroll.priv.dchbx.org'
• Risk: Critical for preventing unauthorized cross-origin requests
• Processes HTTP_X_REQUESTINGIDENTITY header
• Processes HTTP_X_REQUESTINGIDENTITYSIGNATURE header
• Location: validate_resource_identity_signature.rb
• Risk: Core authentication mechanism relies on Rack header processing
• Document upload handling (multipart form data)
• Location: documents_controller.rb:52-100
• File streaming via ActionController::Live
• Response header manipulation (Content-Type, Content-Disposition, Cache-Control)
• Risk: File upload vulnerabilities could allow malicious content
ℹ️ LOW PRIORITY - Test Infrastructure
• Rack::Test::UploadedFile for simulating uploads in tests
• Risk: Minimal - test-only usage
FUNCTIONAL AREAS:
USAGE NOTES:
• Rack is fundamental to the application's HTTP layer
• Rails 7.2 uses Rack 3.x with multiple Rack-based middleware
• Application implements custom authentication via Rack request headers
• Uses Rack's streaming capabilities for large file downloads
RECOMMENDATIONS:
• Test CORS configuration thoroughly - verify cross-origin restrictions work
• Test custom authentication header processing end-to-end
• Verify file upload handling with various file types and sizes
• Test file download streaming functionality
• Review error handling for malformed requests
• Run integration tests for all API endpoints
================================================================================
TESTING PRIORITIES
CRITICAL (Must Test):
RECOMMENDED (Should Test):
5. All API endpoints for general regression
6. Error handling for malformed JSON
7. Error handling for malformed HTTP requests
LOW PRIORITY (Optional):
8. Test suite passes (loofah & nokogiri are test dependencies)
================================================================================
VERIFICATION STATUS
✓ bundler-audit scan: No vulnerabilities found
✓ All gems successfully updated
✓ Gemfile.lock updated
Next Steps:
→ Run full test suite
→ Deploy to staging environment for integration testing
→ Monitor application logs for any parsing errors
→ Review and test priority areas listed above